From: Paul Donald Date: Sun, 22 Jun 2025 20:35:46 +0000 (+0200) Subject: luci-base: check for wifi system feature before Promise.all X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=9c0f071bbd1150b324a5c1b2f0e1f642da693128;p=project%2Fluci.git luci-base: check for wifi system feature before Promise.all Allows the hasSystemFeature call to complete before executing the Promise bundle. Signed-off-by: Paul Donald --- diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index a04f4fce9e..953f4f9f68 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -349,6 +349,7 @@ function maskToPrefix(mask, v6) { function initNetworkState(refresh) { if (_state == null || refresh) { + const hasWifi = L.hasSystemFeature('wifi'); _init = _init || Promise.all([ L.resolveDefault(callNetworkInterfaceDump(), []), L.resolveDefault(callLuciBoardJSON(), {}), @@ -357,7 +358,7 @@ function initNetworkState(refresh) { L.resolveDefault(callLuciHostHints(), {}), getProtocolHandlers(), L.resolveDefault(uci.load('network')), - L.hasSystemFeature('wifi') ? L.resolveDefault(uci.load('wireless')) : L.resolveDefault(), + hasWifi ? L.resolveDefault(uci.load('wireless')) : L.resolveDefault(), L.resolveDefault(uci.load('luci')) ]).then(function(data) { var netifd_ifaces = data[0],